# coding=utf-8


"""This module is a wrapper for event requests"""

from pypalo.basic import response, url, default, arguments

request_group="event"

def begin(sid, source, event, host=default["host"], port=default["port"]):
	'''
	This function wraps PALO API Request
	http://[SERVER]:[PORT]/event/begin[?PARAMETER1=value[&...]].
	
	Parameters:
		sid [string] <Session identifier for a server connection. A supervision server has to use his session identifier here which is communicated by Palo to a supervision server during startup. A supervision must not use login to obtain a session identifier.>
		source [string] <Session identifier used for logging during the event. All requests between the "event/begin" and "event/end" are logged with the user of the source session instead of the user of the current session denoted by the "sid" parameter. A supervision server has to fill the source parameter with the session identfier which triggered the supervision server.>
		event [string] <String used for logging during the event. All requests between the "event/begin" and "event/end" are logged with this string as event. A supervision server has to fill the event parameter with the area identifier which triggered the supervision server.>
	
	Result:
		0 OK [boolean] <"1" means OK>
	
	More info at http://host:port/api/event/begin
	'''
	#beginning of function suite
	request_name="begin"
	#end of function suite
	return response(url(host, port, request_group, request_name, arguments(locals())))

def end(sid, host=default["host"], port=default["port"]):
	'''
	This function wraps PALO API Request
	http://[SERVER]:[PORT]/event/end[?PARAMETER1=value[&...]].
	
	Parameters:
		sid [string] <Session identifier for a server connection. A supervision server has to use his session identifier here which is communicated by Palo to a supervision server during startup. A supervision must not use login to obtain a session identifier.>

	Result:
		0 OK [boolean] <"1" means OK>
	
	More info at http://host:port/api/event/end
	'''
	#beginning of function suite
	request_name="end"
	#end of function suite
	return response(url(host, port, request_group, request_name, arguments(locals())))

#querys dictionary
query={}
query["begin"]=begin
query["end"]=end

#end of event module suite